package framework.converters;

import framework.IConvertFunction;

/**
 * Converter class that converts Fahrenheit to Celsius degrees
 */
public class ConvertTempFC implements IConvertFunction {

    /**
     *
     * @param measure temperature measurement in Fahrenheit
     * @return the temperature measurement converted to Celsius
     */
    public long convert(long measure) {
        double val = Double.longBitsToDouble(measure);
        val = (val - 32) * 5 / 9;

        return Double.doubleToLongBits(val);
    }
}
